/*
 * PyMineralKinetics.cpp
 *
 *  Created on: Jan 2, 2012
 *      Author: allan
 */

#include "PyMineralKinetics.h"

// GeoReact includes
#include <GeoReact.h>

// Boost includes
#include <boost/python.hpp>
using namespace boost::python;

// PyGeoReact includes
#include <Common/PyVector.h>

void export_MineralKinetics()
{
	class_<MineralCatalyst>("MineralCatalyst", init<>())
		.def(init<const std::string&, const std::string&, double>())
		
		.def_readwrite("name",
			&MineralCatalyst::name)
		
		.def_readwrite("index",
			&MineralCatalyst::index)
		
		.def_readwrite("quantity",
			&MineralCatalyst::quantity)
		
		.def_readwrite("power",
			&MineralCatalyst::power);
	
	
	class_<MineralMechanism>("MineralMechanism", init<>())
		.def(init<double, double>())
		
		.def(init<double, double, const MineralCatalyst&>())
		
		.def(init<double, double, const std::vector<MineralCatalyst>&>())

		.def_readwrite("k",
			&MineralMechanism::k)
		
		.def_readwrite("Ea",
			&MineralMechanism::Ea)
		
		.def_readwrite("catalysts",
			&MineralMechanism::catalysts);
	
	
	class_<MineralKineticsInfo>("MineralKineticsInfo", init<>())
		.def(init<const std::string&>())
		
		.add_property("mineral",
			&MineralKineticsInfo::GetMineralName,
			&MineralKineticsInfo::SetMineralName)
		
		.add_property("specific_surface_area",
			&MineralKineticsInfo::GetSpecificSurfaceArea,
			&MineralKineticsInfo::SetSpecificSurfaceArea)
		
		.add_property("mechanisms",
			make_function(&MineralKineticsInfo::GetMineralMechanisms,
				return_internal_reference<>()),
			&MineralKineticsInfo::SetMineralMechanisms)
		
		.def("SetMineralName",
			&MineralKineticsInfo::SetMineralName)
		
		.def("SetSpecificSurfaceArea",
			&MineralKineticsInfo::SetSpecificSurfaceArea)
		
		.def("AddMineralMechanism",
			&MineralKineticsInfo::AddMineralMechanism)
		
		.def("SetMineralMechanisms",
			&MineralKineticsInfo::SetMineralMechanisms)
		
		.def("GetMineralName",
			&MineralKineticsInfo::GetMineralName)
		
		.def("GetSpecificSurfaceArea",
			&MineralKineticsInfo::GetSpecificSurfaceArea)
		
		.def("GetMineralMechanisms",
			&MineralKineticsInfo::GetMineralMechanisms,
				return_internal_reference<>());
	
		
		export_std_vector<MineralCatalyst>("MineralCatalystVector");
		export_std_vector<MineralMechanism>("MineralMechanismVector");
}
